package edu.faytechcc.csc289.gui;

import java.awt.*;
import java.awt.event.*;

/**
 * Class is used to move any window around while undecorated
 * 
 * Mar 30, 2014
 * @author William Robles
 */
public class MouseActions implements MouseListener, MouseMotionListener
{
    static Point mouseDownCompCoords;

    @Override
    public void mouseClicked(MouseEvent me)
    {
        
    }

    @Override
    public void mousePressed(MouseEvent me)
    {
        mouseDownCompCoords = me.getPoint();
    }

    @Override
    public void mouseReleased(MouseEvent me)
    {
        mouseDownCompCoords = null;
    }

    @Override
    public void mouseEntered(MouseEvent me)
    {
        
    }

    @Override
    public void mouseExited(MouseEvent me)
    {
        
    }

    @Override
    public void mouseDragged(MouseEvent me)
    {
        Point currCoords = me.getLocationOnScreen();
                me.getComponent().setLocation(currCoords.x - mouseDownCompCoords.x,
                        currCoords.y - mouseDownCompCoords.y);
    }

    @Override
    public void mouseMoved(MouseEvent me)
    {
        
    }

}
